package com.cefa.finance.model;

import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "cefa_finance_accident_record")
public class AccidentRecord {

    private Long id;
    private Long contractId;
    private Long userId;
    private Long vehicleId;
    private Date accidentDate;
    private Double accidentCost;
    private String fixedItems;

    private Long recordUser;
    private Boolean blockStatus;
    private String blockHash;
    private String blockNumber;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getContractId() {
        return contractId;
    }

    public void setContractId(Long contractId) {
        this.contractId = contractId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getVehicleId() {
        return vehicleId;
    }

    public void setVehicleId(Long vehicleId) {
        this.vehicleId = vehicleId;
    }

    @JSONField(format = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    public Date getAccidentDate() {
        return accidentDate;
    }

    public void setAccidentDate(Date accidentDate) {
        this.accidentDate = accidentDate;
    }

    public Double getAccidentCost() {
        return accidentCost;
    }

    public void setAccidentCost(Double accidentCost) {
        this.accidentCost = accidentCost;
    }

    @Lob
    @Column(columnDefinition="TEXT")
    public String getFixedItems() {
        return fixedItems;
    }

    public void setFixedItems(String fixedItems) {
        this.fixedItems = fixedItems;
    }

    public Long getRecordUser() {
        return recordUser;
    }

    public void setRecordUser(Long recordUser) {
        this.recordUser = recordUser;
    }

    public Boolean getBlockStatus() {
        return blockStatus;
    }

    public void setBlockStatus(Boolean blockStatus) {
        this.blockStatus = blockStatus;
    }

    public String getBlockHash() {
        return blockHash;
    }

    public void setBlockHash(String blockHash) {
        this.blockHash = blockHash;
    }

    public String getBlockNumber() {
        return blockNumber;
    }

    public void setBlockNumber(String blockNumber) {
        this.blockNumber = blockNumber;
    }
}
